import 'package:FiduMart/generated/json/base/json_convert_content.dart';
import 'package:FiduMart/core/network/model/guild_state_entity.dart';

GuildStateEntity $GuildStateEntityFromJson(Map<String, dynamic> json) {
  final GuildStateEntity guildStateEntity = GuildStateEntity();
  final int? state = jsonConvert.convert<int>(json['state']);
  if (state != null) {
    guildStateEntity.state = state;
  }
  final int? rejectShow = jsonConvert.convert<int>(json['rejectShow']);
  if (rejectShow != null) {
    guildStateEntity.rejectShow = rejectShow;
  }
  final int? applyShow = jsonConvert.convert<int>(json['applyShow']);
  if (applyShow != null) {
    guildStateEntity.applyShow = applyShow;
  }
  final String? guildid = jsonConvert.convert<String>(json['guildid']);
  if (guildid != null) {
    guildStateEntity.guildid = guildid;
  }
  final String? guildName = jsonConvert.convert<String>(json['guildName']);
  if (guildName != null) {
    guildStateEntity.guildName = guildName;
  }
  return guildStateEntity;
}

Map<String, dynamic> $GuildStateEntityToJson(GuildStateEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['state'] = entity.state;
  data['rejectShow'] = entity.rejectShow;
  data['applyShow'] = entity.applyShow;
  data['guildid'] = entity.guildid;
  data['guildName'] = entity.guildName;
  return data;
}

extension GuildStateEntityExt on GuildStateEntity {
  GuildStateEntity copyWith({
    int? state,
    int? rejectShow,
    int? applyShow,
    String? guildid,
    String? guildName,
  }) {
    return GuildStateEntity()
      ..state = state ?? this.state
      ..rejectShow = rejectShow ?? this.rejectShow
      ..applyShow = applyShow ?? this.applyShow
      ..guildid = guildid ?? this.guildid
      ..guildName = guildName ?? this.guildName;
  }
}